/**
 * Created by iallai on 2/1/2018.
 */

import axios from 'axios'
import {CONFIG} from '@/config/env'

let API = CONFIG.PROJECT.API;


const qr = (query = {}) => new Promise((resolve, reject) => {


  axios({
    method: 'get',
    url: `${API.URL}/${API.APPNAME}/tools/wechat/qrcode`,
    params: query,

  }).then(function (res) {
    if (API.isOK(res.data)) {
      resolve(res.data);
    } else {
      reject(res.data.message);
    }
  }).catch(function (err) {
    reject("网络错误");
  });

});


export {qr}

